package com.nd.sdp.android.person5;

import com.nd.sdp.android.person5.di.*;
import com.nd.sdp.android.person5.fly.IFly;
import com.nd.sdp.android.person5.run.IRun;

import javax.inject.Inject;

public class Son {

    @Inject
    IFly fly;
    @Inject
    IRun run;

    public void sonFly() {
        fly.fly();
    }

    public void sonRun() {
        run.run();
    }

    public static void main(String[] args) {
        Son son = new Son();
        RunComponent runComponent = DaggerRunComponent.builder()
                .build();
        PersonComponent personComponent = DaggerPersonComponent.builder()
                .runComponent(runComponent)
                .build();
        personComponent.sonComponent()
                .build()
                .inject(son);
        son.sonFly();
        son.sonRun();
    }

}
